<me:UIWS07 x:Class="WPFExcelReport.TWS06C"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"   
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"  
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWS07.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>      
        <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWS07.Resources>
    <Grid Visibility="{Binding IsYD,ElementName=TV,Converter={StaticResource bv}}" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <StackPanel>
            <WrapPanel>
                <WrapPanel> 
                    <Button    Click="CopyCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/copy.png" />
                        </Button.Background>
                    </Button>
                    <Button    Click="SaveCommand" Height="20" Margin="5,0,0,0" Width="24" IsEnabled="{Binding IsEdit,ElementName=TV}" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Save.png" />
                        </Button.Background>
                    </Button>
                </WrapPanel>
                <WrapPanel >
                    <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                        <Button.Background>
                            <ImageBrush  ImageSource="/ImagePackage;component/Images/Add.png" />
                        </Button.Background>
                    </Button>
                    <WrapPanel Visibility="{Binding IsNew,Converter={StaticResource bv}}">
                        <ex:TXT72    Text="{Binding FARBE,ElementName=TV,Converter={StaticResource gb2312}}" 
                                         MaxLength="10"  Width="60" />

                        <Button   Click="NewCommand" Height="20" Margin="5,0,0,0" Width="24" >
                            <Button.Background>
                                <ImageBrush  ImageSource="/ImagePackage;component/Images/button_ok.png" />
                            </Button.Background>
                        </Button>
                    </WrapPanel>

                </WrapPanel>
                
            </WrapPanel> 
            
            <WrapPanel>
                <WrapPanel>
                    <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=最低库存}}"></TextBlock>
                    <ex:NumericBox Grid.Column="1"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" TabIndex="501"  Text="{Binding WAFRAPPH,Source={StaticResource vwMaster}}" MinWidth="40" Width="Auto" />
                    <TextBlock   Grid.Column="2" Text="{Binding Source={Localization:Translate Word=起订量:}}"></TextBlock>
                    <ex:NumericBox Grid.Column="3"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  TabIndex="502"  Text="{Binding WAFRAPPB,Source={StaticResource vwMaster}}" MinWidth="40" Width="Auto" />

                </WrapPanel>
                <TextBlock   Text="{Binding Source={Localization:Translate Word=颜色组:}}"/>
                <TextBlock    Text="{Binding WAFFDVF}" MinWidth="40" Width="Auto" />
                <SD:K0460 Margin="10,0,0,0"
                      KEY="{Binding WAFFDVF,ElementName=TV}" 
                          IsEdit="{Binding IsEdit,ElementName=TV}"/>
                <TextBlock   Text="{Binding Source={Localization:Translate Word=荧光:}}"/>
                <TextBlock    Text="{Binding WAFPRGRP}" MinWidth="40" Width="Auto" />
                <SD:K9325 Margin="10,0,0,0"
                         KEY="{Binding WAFPRGRP,ElementName=TV}" 
                          IsEdit="{Binding IsEdit,ElementName=TV}"/>
               
            </WrapPanel>
            <WrapPanel>
                <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=描述:}}"/>
                <ex:TXT72 Grid.Column="1"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                                          TabIndex="303"  MaxLength="20"   CharacterCasing="Upper"  
                                          Text="{Binding WAFBEZ,ElementName=TV,Converter={StaticResource gb2312}}"  Width="180" />
                <ex:TXT72  Grid.Column="2" IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"   
                               Text="{Binding WAFGRPBEZ,ElementName=TV,Converter={StaticResource gb2312}}"   Width="200" />

            </WrapPanel>
        </StackPanel>
        <DataGrid  Grid.Row="1"  
                   VerticalAlignment="Top"  
                   AutoGenerateColumns="False"
                   EnableRowVirtualization="False"
                   IsReadOnly="True"
                   VerticalScrollBarVisibility="Auto"
                   HorizontalScrollBarVisibility="Auto"
                   HeadersVisibility="Column"     
                   ItemsSource="{Binding Source={StaticResource vwMaster}}" 
                   IsSynchronizedWithCurrentItem="True" 
                   x:Name="dlgMaster"  
                   RowDetailsVisibilityMode="Visible" Grid.ColumnSpan="2" Margin="0,0,0,0"
                    >
            <DataGrid.Columns> 
               
                <DataGridTextColumn Binding="{Binding Path=WAFZUART,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=类型}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFZUSATZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=色号}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFBEZ,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=描述}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFFDVF,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=颜色组}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFPRGRP,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=荧光}}"  Width="Auto" /> 
                <DataGridTextColumn Binding="{Binding Path=WAFRAPPH}" Header="{Binding Source={Localization:Translate Word=最低库存}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFRAPPB}" Header="{Binding Source={Localization:Translate Word=起订量}}"  Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=WAFDDIM}" Header="{Binding Source={Localization:Translate Word=单位}}"  Width="Auto" /> 
            </DataGrid.Columns>
        </DataGrid  >
        <WrapPanel Grid.Row="2">
            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=更改:}}"/>
            <TextBlock    Text="{Binding WAFAENDBEN}" MinWidth="40" Width="Auto" />
            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=日期:}}"/>
            <TextBlock    Text="{Binding WAFAENDDAT}" MinWidth="40" Width="Auto" />
            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=创建:}}"/>
            <TextBlock    Text="{Binding WAFNEUBEN}" MinWidth="40" Width="Auto" />
            <TextBlock   Grid.Column="0" Text="{Binding Source={Localization:Translate Word=日期:}}"/>
            <TextBlock    Text="{Binding WAFNEUDAT}" MinWidth="40" Width="Auto" />
        </WrapPanel>
    </Grid>
</me:UIWS07>
